Design Patterns in JDK Collections
ثبت نشده
چکیده
Teaching Java is more challenging than teaching C++ or C, since instructors must at least survey various bundled and closely-related toolkits, beginning with the JDK API; for example, Swing, AWT, JDBC, JAXP, and the internationalization and collections frameworks, among others. Students of Java must learn when and how to leverage them; no one whose first instinct would be to implement a parser for some "little language" from scratch would find a job, let alone survive a first course in Java. Whatever sidebars introducing Design Patterns most texts offer are motivated by coverage of Swing, Java collections, or EJB. This is a tacit recognition that understanding design patterns is more critical to understanding these frameworks than, say, mechanics of the Java language. All these frameworks exemplify dependence on design patterns. Even a textbook such as Horstmann and Cornell1, although mentioning GOF patterns in connection with Java collections/Swing, merely scratches the surface, instead of structurally integrating them. The collections framework, in particular, offers a fairly well-defined and accessible domain within which design patterns enable achieving key architectural goals. Following the development of the collections framework through successive releases offers a case study on how design patterns interact with supporting graceful software evolution. At a tactical level, the collections framework provides a rich repository of decisions about how to implement design patterns, demonstrating how features of the Java language which may appear unmotivated when presented in textbook examples facilitate resolving implementation issues.
منابع مشابه
Java Security Anti-Patterns: The Unguarded Layer Switch
According to Gamma et al. Patterns (1995) are known as commonly used solutions to common problems. AntiPatterns in contrast, as described by Brown et al. (1998) are best described as solutions to problems that generates additional negative consequences to the already existing problem. Causes for anti-patterns are on the one hand insufficient knowledge in applying a design pattern or experience ...
متن کاملSoftware Similarities: a Case Study with Some General Implications
Generic design aims at achieving non-redundancy by unifying differences among similar program concepts or structures at the design and code levels, for simplification purpose. The extent to which similar program structures deliberately spread through programs, indicates that potentials of generic design may not be fully exploited. While not all such recurring similar program structures are nece...
متن کاملUnifying Software Similarity Patterns with a Meta-level Generative Technique: A Case Study and Evaluation
In a previous study, we analyzed similarity patterns in the Java Buffer library, JDK 1.5. We observed many similar classes, methods and yet smaller fragments elements of class design. We argued that, given the design goals, it was difficult to avoid those repetitions with conventional design techniques. We also argued that the reasons why the problem arises and its symptoms are common. In this ...
متن کاملScalable Producer-Consumer Pools Based on Elimination-Diffraction Trees
Producer-consumer pools, that is, collections of unordered objects or tasks, are a fundamental element of modern multiprocessor software and a target of extensive research and development. For example, there are three common ways to implement such pools in the Java JDK6.0: the SynchronousQueue, the LinkedBlockingQueue, and the ConcurrentLinkedQueue. Unfortunately, most pool implementations, inc...
متن کاملSome Examples of Generics in Java 1.5
The forthcoming releases of Java JDK v1.5 and C# v2.0 support generic classes (classes with generic type parameters) and generic methods. Furthermore, each also supports constrained generic types. Much has been written about generic types. In " A Comparative Study of Language Support for Generic Programming " by Garcia et al details of generic types and programming in C++, Haskell, Standard ML,...
متن کامل